home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11812 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: cs.city.ac.uk!usenet
  2. From: h <Lone@Ranger.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Beginer C please help me
  5. Date: Tue, 26 Mar 1996 19:24:01 +0000
  6. Organization: DiM (Damsell in Distress)
  7. Message-ID: <31584451.4A56@Ranger.uk>
  8. References: <DoLCFx.B7x.0.bloor@torfree.net> <4iq6uc$evq@daryl.scsn.net> <4irjqa$jtn@winx03.informatik.uni-wuerzburg.de>
  9. NNTP-Posting-Host: causeland.city.ac.uk
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.3 sun4m)
  14.  
  15. Jochen Schoof wrote:
  16. > Scott Shrader (shrader@scsn.net) wrote:
  17. > : In article <DoLCFx.B7x.0.bloor@torfree.net>, bz786@torfree.net says...
  18. > : >
  19. > : >This may be a stupid mistake but "please help" me.
  20. > : >Thank you very much.
  21. > : >
  22. > : >#include <stdio.h>
  23. > : >#include <math.h>
  24. > : >main ()
  25. > : >{
  26. > : >float n;
  27. > : >n=(9/5);
  28.         ^^^
  29.  
  30. use 9.0 / 5.0 instead...
  31.  
  32.  
  33.  
  34. > : >printf ("n=   %1.3f\n", n);
  35. > : >}
  36. > : >I have complied and run the programme & I got the answer n=1.000
  37. > : >but Iam supposed to get answer 1.8.
  38. > : >Why I got this answer?
  39. > : >--
  40. > : you can write this by skipping  printf("n=   %1.3f\n", n); and put in
  41. > : printf("%f",n);
  42. > :
  43. > : Try this to see how this works.
  44. > What you wrote is complete nonsense. How about testing the programs
  45. > before posting them..? Even learning C might be of help.
  46. > : I'm a bit new at this too, but I think this will work.
  47. > If you have to use phrases like "I think it will work" or "I'm not sure"
  48. > in your posting, please don't post it. There are enough folks around
  49. > here who know for sure - especially in elementary cases like this one.
  50. > - Jochen
  51. > --
  52. Perhaps... Jochen it would also help if you posted the answers???
  53.  
  54. Just trying to help...
  55. H
  56.